package com.project.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.time.LocalDate;
import java.util.List;

/**
 * 销售信息
 * （销售编号，销售日期（当前时间），订单金额，送货地址，
 * 客户名称,销售员真实姓名，销售详情集合）
 */
@Data
@ApiModel(value = "销售信息")
@TableName("t_sellorder")
public class SellOrderBean {
    @ApiModelProperty(hidden = true)
    @TableId(value = "pk_sellOrderId",type = IdType.AUTO)
    private Integer id;
    @ApiModelProperty(value = "销售时间")
    @TableField("o_date")
    private LocalDate date=LocalDate.now();//销售时间
    @ApiModelProperty(value = "订单金额")
    @TableField("o_orderPrice")
    private Integer orderPrice;//订单金额
    @ApiModelProperty(value = "送货地址")
    @TableField("o_senAddress")
    private String address;//送货地址
    @ApiModelProperty(value = "客户名称")
    @TableField("o_customName")
    private String customName;//客户名称
    @ApiModelProperty(value = "销售员真实姓名")
    @TableField("o_userName")
    private String userName;//销售员真实姓名
    @ApiModelProperty(value = "销售详情集合")
    @TableField(exist = false)
    private List<SellDetailBean> sellDetailList;//销售详情集合

    public SellOrderBean() {
    }

    public SellOrderBean(Integer orderPrice, String address, String customName, String userName) {
        this.orderPrice = orderPrice;
        this.address = address;
        this.customName = customName;
        this.userName = userName;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public LocalDate getDate() {
        return date;
    }

    public void setDate(LocalDate date) {
        this.date = date;
    }

    public Integer getOrderPrice() {
        return orderPrice;
    }

    public void setOrderPrice(Integer orderPrice) {
        this.orderPrice = orderPrice;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getCustomName() {
        return customName;
    }

    public void setCustomName(String customName) {
        this.customName = customName;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public List<SellDetailBean> getSellDetailList() {
        return sellDetailList;
    }

    public void setSellDetailList(List<SellDetailBean> sellDetailList) {
        this.sellDetailList = sellDetailList;
    }

    @Override
    public String toString() {
        return "SellOrderBean{" +
                "id=" + id +
                ", date=" + date +
                ", orderPrice=" + orderPrice +
                ", address='" + address + '\'' +
                ", customName='" + customName + '\'' +
                ", userName='" + userName + '\'' +
                ", sellDetailList=" + sellDetailList +
                '}';
    }
}
